package com.cskaoyan.utils;

import com.cskaoyan.bean.Goods;
import com.cskaoyan.bean.vo.HotListNumsVO;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @PROJECT_NAME: market_34th
 * @DESCRIPTION:
 * @Author: qiu
 * @DATE: 2021/10/24 23:18
 */
public class HotGoodsSortUtil {

    // 对list以pv的规则进行排序
    public static ArrayList<HotListNumsVO> sort(ArrayList<HotListNumsVO> list){

        Comparator<HotListNumsVO> comparator = new Comparator<HotListNumsVO>(){
            @Override
            public int compare(HotListNumsVO o1, HotListNumsVO o2) {
                return (o2.getNums() - o1.getNums());
            }
        };

        Collections.sort(list,comparator);

        return list;
    }

}
